#include "Alice.h"
using namespace alice;


CSocket::CSocket() {
	m_hSocket = INVALID_SOCKET;
}

CSocket::CSocket( SOCKET sock ) {
	m_hSocket = sock;
}

CSocket::~CSocket( void ) {
	closesocket( m_hSocket );
}

BOOL CSocket::Create( int af, int type, int protocol ) {
	m_hSocket = socket( af, type, protocol );
	return ( m_hSocket != INVALID_SOCKET );
}

VOID CSocket::Close( void ) {
	closesocket( m_hSocket );
}

CSocket::operator SOCKET( void ) const {
	return m_hSocket;
}